<template>
  <div class="df-header">
    <el-button size="small" v-for="item in btnList" :key="item.funName" :type="item.type" @click="handelBtn(item.funName)">{{ item.label }}</el-button>
    <div class="df-search">
      <el-input clearable size="small" placeholder="请输入内容" v-model="searchStr" @input="searchinput"></el-input>
      <el-button size="small" type="primary" icon="el-icon-search" @click="handelBtn('search')">搜索</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'dfHeader',
  props:{
    btnList:Array,
    search:Boolean,
  },
  data(){
    return {
      searchStr: ''
    }
  },
  methods: {
    handelBtn(func){
      this.$emit('btnclick', func)
    },
    searchinput(value) {
      this.searchStr = value
      this.$emit("skeyinput",this.searchStr);
    }
  },
}
</script>

<style lang="scss">
$color-primary-blue:#4285F4;
.df-header{
  padding: 10px 15px;
  background-color: #f2f2f2;
}
.df-search{
  float: right;
  .el-input {
    width: 250px;
    input{
      border-right: 0;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
  .el-button {
    display: inline-block;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}
</style>